package	org.thot.display
{
	import flash.display.Sprite;
	import org.thot.model.ge.GameEvent;
	/**
	 * ...
	 * @author Thot
	 */
	public class GameEventLib extends Sprite
	{
		
		protected var m_gameEvents:Vector.<GameEvent>;
		
		
		public function GameEventLib() 
		{
			init();
		}
		
		private function init():void 
		{
			m_gameEvents = new Vector.<GameEvent>();
		}
		
		protected function addGameEvent( p_gameEvent:GameEvent ):void
		{
			m_gameEvents.push( p_gameEvent );
		}
		
		public function get gameEvents():Vector.<GameEvent> 
		{
			return m_gameEvents;
		}
		
		public function destroy():void
		{
			m_gameEvents = null;
			
			while ( numChildren > 0 )
			{
				removeChildAt(0);
			}
			
			if ( parent && parent.contains( this ) )
			{
				parent.removeChild( this );
			}
			delete this;
		}
		
	}

}